package com.example.safeassistan.train.adapter;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.safeassistan.R;
import com.example.safeassistan.train.model.ReportCardModel;

import java.util.List;


public class ActivityReportCardAdapter extends BaseQuickAdapter<ReportCardModel.ResultDTO.HistoryListDTO, BaseViewHolder> {

    public ActivityReportCardAdapter(List<ReportCardModel.ResultDTO.HistoryListDTO> data) {
        super(R.layout.item_report_card_history, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ReportCardModel.ResultDTO.HistoryListDTO item) {
        if(helper.getPosition()==0){
            helper.getView(R.id.line).setVisibility(View.GONE);
        }
        helper.setText(R.id.tvScore,item.getPaperMark()+"分");
        helper.setText(R.id.tvUseTime,item.getUseTime());
        helper.setText(R.id.tvCreateTime,item.getAnswerTime());
        helper.setText(R.id.tvStatus,item.getPaperResult());
    }
}
